<?php
namespace Home\Model;
use Think\Model\ViewModel;
class StudentsViewModel extends ViewModel {
  public $viewFields = array(
      'Student'=>array('id','name','user_name','create_time','is_delete','status'),
      'Class'=>array('name'=>'other','_on'=>'Student.class_id=Class.id')
  );
  public function listMap( $map = array() , $limit = '0,10')
  {
      return $this->where( $map )->limit( $limit )->select();
  }
  public function countMap($map=array())
  {
    return $this->where($map)->count();
  }
}